home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
MacHack 1997
/
MacHack 1997.toast
/
Hacks
/
Hacks ’96
/
PredatorPrey
/
EditM.c
< prev
next >
Wrap
Text File
|
1996-06-22
|
4KB
|
188 lines
/* EditM.c */
/* Created 930522 09:34 AM by AppMaker */
#include <Types.h>
#include <Quickdraw.h>
#include <Controls.h>
#include <Dialogs.h>
#include <Editions.h>
#include <Events.h>
#include <Lists.h>
#include <Menus.h>
#include <TextEdit.h>
#include "ResourceDefs.h"
#include "DoScrap.h"
#include "Globals.h"
#include "EditM.h"
static void DoUndo (void);
static void DoCut (void);
static void DoCopy (void);
static void DoPaste (void);
static void DoClear (void);
/*static void DoSelectAll (void);*/
/*static void DoCreatePublisher (void);*/
/*static void DoSubscribeTo (void);*/
/*static void DoSubscriberOptions (void);*/
/*static void DoShowClipboard (void);*/
void editM_seg() {} /* for reference in "UnloadSeg()" calls */
/*----------*/
void InitEditM ()
{
} /*InitEditM*/
/*----------*/
static void DoUndo (void)
{
} /*DoUndo*/
/*----------*/
static void DoCut (void)
{
} /*DoCut*/
/*----------*/
static void DoCopy (void)
{
} /*DoCopy*/
/*----------*/
static void DoPaste (void)
{
} /*DoPaste*/
/*----------*/
static void DoClear (void)
{
} /*DoClear*/
/*----------*/
static void DoSelectAll (void)
{
} /*DoSelectAll*/
/*----------*/
static void DoCreatePublisher (void)
{
#if 0
OSErr theErr;
NewPublisherReply pdReply;
#include <Packages.h>
pdReply.usePart = false;
pdReply.preview = nil; /*should be handle to and*/
pdReply.previewFormat = 'TEXT'; /*type of preview data*/
/* fill in pdReply.container: */
HLock ((Handle)cur->filename);
theErr = FSMakeFSSpec(cur->volNum, 0L /*dirID*/, *cur->filename,
&pdReply.container.theFile);
/*should really pass default edition name*/
/*instead of cur->filename*/
HUnlock ((Handle)cur->filename);
if (theErr == noErr) { /* FSMakeFSSpec went ok */
pdReply.container.theFileScript = iuCurrentScript;
/* should be script code for cur->filename */
pdReply.container.thePart = kPartsNotUsed;
pdReply.container.thePartName[0] = 0; /* not used */
pdReply.container.thePartScript = 0; /* not used */
theErr = NewPublisherDialog (&pdReply);
if ((theErr == noErr) && (!pdReply.canceled)) {
/* handle new publisher */
} /* otherwise, NewPublisherDialog error or user cancelled */
} else {
/* handle FSMakeFSSpec error */
}
#endif
} /*DoCreatePublisher*/
/*----------*/
static void DoSubscribeTo (void)
{
OSErr theErr;
NewSubscriberReply sdReply;
sdReply.formatsMask = kTEXTformatMask;
theErr = GetLastEditionContainerUsed (&sdReply.container);
theErr = NewSubscriberDialog (&sdReply);
if (!sdReply.canceled) {
/* handle subscriber to */
}
} /*DoSubscribeTo*/
/*----------*/
/* This procedure displays either the publisher options or */
/* subscriber options dialog, depending on what's selected. */
/*----------*/
static void DoSubscriberOptions (void)
{
OSErr theErr;
SectionOptionsReply soReply;
theErr = SectionOptionsDialog (&soReply);
if ((theErr == noErr) && (!soReply.canceled)) {
switch (soReply.action) {
case 'read': /* "Get Edition Now" */
break;
case 'writ': /* "Send Edition Now" */
break;
case 'goto': /* "Open Publisher" */
break;
case 'cncl': /* "Cancel Publisher/Subscriber" */
break;
case ' ': /* "OK" */
break;
} /* switch */
}
} /*DoSubscriberOptions*/
/*----------*/
static void DoShowClipboard (void)
{
} /*DoShowClipboard*/
/*----------*/
void DoEdit (short itemNr)
{
switch (itemNr) {
case EditUndo:
DoUndo (); /* this */
break;
case EditCut:
DoCut (); /* this */
break;
case EditCopy:
DoCopy (); /* this */
break;
case EditPaste:
DoPaste (); /* this */
break;
case EditClear:
DoClear (); /* this */
break;
/*case EditSelectAll:*/
/* DoSelectAll ();*/
/* break;*/
/* case EditCreatePublisher:*/
/* DoCreatePublisher ();*/
/* break;*/
/* case EditSubscribeTo:*/
/* DoSubscribeTo ();*/
/* break;*/
/* case EditSubscriberOptions:*/
/* DoSubscriberOptions ();*/
/* break;*/
/* case EditShowClipboard:*/
/* DoShowClipboard ();*/
/* break;*/
} /*switch*/
} /*DoEdit*/
/* Edit */